<template>
  <el-container class="container">
    <img class="nyImg" src="../../assets/images/j1.jpg" />
    <img class="nyImg" src="../../assets/images/j2.jpg" />
    <img class="nyImg" src="../../assets/images/j3.jpg" />
    <img class="nyImg" src="../../assets/images/j4.jpg" />
    <div class="imgBox">
      <img class="nyImg" src="../../assets/images/j5.jpg" />
      <div class="tips">
        <span style="margin-right: 20px;">友情提示：投资有风险 选择需谨慎</span>
        <span>技术支持：江门市蓬江区行通商贸有限公司 粤ICP备18134847号</span>
      </div>
    </div>
    <div class="pc">
      <el-input style="width:2rem" v-model="name" placeholder="请输入姓名"></el-input>
      <el-input style="width:2rem;margin-left:20px" v-model="phone" placeholder="请输入手机号码"></el-input>
      <div class="submitPc" @click="submit">获取加盟资料</div>
      <div class="tel">加盟热线：400-169-0574</div>
    </div>
  </el-container>
</template>

<script>
import store from "@/utils/factory";
export default {
  computed: {},
  name: "detail",
  data() {
    return {
      name: "",
      phone: "",
      device: "",
      joinButtonStatus: true,
      submitStatus: true
    };
  },
  created() {
    document.title = "吉姆大师傅";
    window.scroll(0, 0);
  },
  mounted() {},
  methods: {
    phoneCall() {
      window.location.href = "tel:400-169-0574";
    },
    scrollTo() {
      window.scrollTo(0, document.body.clientHeight);
    },
    submit() {
      let self = this;
      if (!this.name) {
        this.$alert("请输入您的姓名", "提示", {
          confirmButtonText: "确定",
          callback: action => {}
        });
        return false;
      }
      if (!this.phone) {
        this.$alert("请输入您的手机号码", "提示", {
          confirmButtonText: "确定",
          callback: action => {}
        });
        return false;
      }
      this.axios
        .post("http://112.124.18.81/platform/message/report", {
          name: this.name,
          phone: this.phone,
          sourcePage: window.location.href,
          project: 112,
          content: "我要申请加盟"
        })
        .then(function(res) {
          self.$alert("提交成功", "提示", {
            confirmButtonText: "确定",
            type: "success",
            callback: action => {}
          });
        })
        .catch(function(err) {
          self.$alert("提交失败", "提示", {
            confirmButtonText: "确定",
            type: "error",
            callback: action => {}
          });
        });
    }
  }
};
</script>

<style rel="stylesheet/less" lang="less" scoped>
.nyImg {
  width: 100%;
}

.container {
  display: flex;
  flex-direction: column;
}

.tel {
  margin-left: 23px;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
}

.pcBox {
  font-size: 0.32rem;
}

.pcLabel {
  width: 2rem !important;
}

.submit {
  background: #fff;
  border-radius: 0.08rem;
  border: none;
  border-radius: 0.8rem;
  font-size: 0.24rem;
  font-weight: bold;
  width: 2.2rem;
  text-align: center;
  height: 0.7rem;
  line-height: 0.7rem;
}

.submitPc {
  margin-left: 20px;
  color: #fff;
  border-radius: 0.08rem;
  border: none;
  font-size: 0.24rem;
  font-weight: bold;
  text-align: center;
  padding: 0.15rem 0.2rem;
  background: rgb(195, 13, 35);
  cursor: pointer;
  &:hover {
    color: #fff;
    background: rgba(195, 13, 35, 0.8);
  }
}

.joinButton {
  margin-top: 0.2rem;
  font-size: 0.28rem;
  background: #f56c6c;
  color: #fff;
  padding: 0.14rem;
  border-radius: 0.08rem;
}

.mobile {
  display: flex;
  position: fixed;
  bottom: 0;
  padding: 0.2rem 0;
  justify-content: center;
  background: #eb9500;
  width: 100%;
}

.pc {
  display: flex;
  position: fixed;
  bottom: 0;
  padding: 0.2rem 0;
  align-items: center;
  justify-content: center;
  background: #eb9500;
  width: 100%;
}

.item {
  display: flex;
  align-items: center;
  flex: 1;
}

.inputArea {
  position: absolute;
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
  left: 0.8rem;
  right: 0.8rem;
  align-items: center;
  justify-content: center;
}

.msgBox {
  position: relative;
  margin-bottom: 1rem;
}

.imgBox {
  width: 100%;
  margin-bottom: 77px;
  position: relative;
}

.tips {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 35px;
  font-size: 12px;
}
</style>